/**
 *#info
 *@author   wuwg
 *@createTime   2018/03/20
 *@updateTime   2018/05/02
 *@description  链接控件，类似a标签
 */
import config from '../../../config/config.js'

/**
 * #item
 *
 * @type aty-link
 * @cn   链接
 * @menu 基础
 * @stPlugin true
 * @nameprop  text
 * @stContainer false
 * @children [aty-image,aty-button,aty-icon,aty-text]
 * @mixins   [./components/components/basic/$listenersAnnotation.js]
 */
const _prefix = config.prefix + '-link'
// 模块
const module = {
  name: _prefix,
  props: {
    /**
     * #property
     *
     * @name href
     * @cn   href链接
     * @type string
     * @description a标签的href属性
     */
    href: {
      type: String,
      default: null
    },
    /**
     * #property
     *
     * @name target
     * @cn   target指向
     * @type string
     * @value  _blank
     * @description a标签的target属性
     */
    target: {
      type: String,
      default: '_blank'
    },
    /**
     * #property
     *
     * @name text
     * @cn 文本
     * @type string
     * @value link
     * @description 文本内容
     */
    text: {
      type: String,
      default: 'link'
    }
  },
  computed: {
    classes () {
      return [`${_prefix}`]
    },
    attrs () {
      return Object.assign({},
        // 默认属性
        {
          href: this.href,
          target: this.target
        },
        this.$attrs
      )
    }
  }
}
export default module
